Check for existence of sincos
authorMatthias Clasen <mclasen@redhat.com>
Wed, 4 Mar 2015 11:30:13 +0000 (06:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 4 Mar 2015 11:30:13 +0000 (06:30 -0500)
It apparently doesn't exist everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=745578

configure.ac
tests/gtkgears.c

index d9ca018cd30bd9c47d54948f8bbe852998597b43..ccbd350b531766d2c49717f40148ed0c7aacfe18 100644 (file)
@@ -826,7 +826,7 @@ AC_TYPE_UID_T
 
 # Check for round(), rint(), isnan(), isinf() and nearbyint()
 AC_CHECK_LIB(m,round,,)
-AC_CHECK_FUNCS(round rint nearbyint)
+AC_CHECK_FUNCS(round rint nearbyint sincos)
 AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
 
 # Checks for gdkspawn
index dfe66c354eb3020ca40d1bbdc175ff9c7efd80b3..fe36bf4822c7ba5f547922a4546d03da79ede3bf 100644 (file)
@@ -36,6 +36,8 @@
  */
 
 #define _GNU_SOURCE
+#include "config.h"
+
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
 #define VERTICES_PER_TOOTH 34
 #define GEAR_VERTEX_STRIDE 6
 
+#ifndef HAVE_SINCOS
+static void
+sincos (double x, double *_sin, double *_cos)
+{
+  *_sin = sin (x);
+  *_cos = cos (x);
+}
+#endif
+
 /**
  * Struct describing the vertices in triangle strip
  */